//
//  ZKHttpManager.m
//  ZKCompetitionApp
//
//  Created by 凯朱 on 2019/8/24.
//

#import "ZKHttpManager.h"

@implementation ZKHttpManager
 //用户登录
+(void)loginWithParams:(NSDictionary *)params finished:(ZCRequiredFinished)finished{
    [self postWithPath:@"/app/login" params:params finished:finished];
}

+(void)postWithPath:(NSString *)path params:(NSDictionary *)params finished:(ZCRequiredFinished)finished{
    NSString *urlStr = [NSString stringWithFormat:@"%@%@",URL_main,path];
    [ZCBaseRequestManager requestWithUrl:urlStr method:POST params:params finished:^(BOOL isSuccessed, id  _Nonnull result, NSString * _Nonnull code, NSString * _Nonnull message) {
        if (finished) finished(isSuccessed,result,code,message);
    }];
}

+(void)getWithPath:(NSString *)path params:(NSDictionary *)params finished:(ZCRequiredFinished)finished{
    NSString *urlStr = [NSString stringWithFormat:@"%@%@",URL_main,path];
    [ZCBaseRequestManager requestWithUrl:urlStr method:GET params:params finished:^(BOOL isSuccessed, id  _Nonnull result, NSString * _Nonnull code, NSString * _Nonnull message) {
        if (finished) finished(isSuccessed,result,code,message);
    }];
}


@end
